import { Controller, Post } from '@midwayjs/core';
import { PurSupplierGroupVo } from '../dtos/pur_supplier_group.dto';
import Mock from 'mockjs';

@Controller('/mes/make/process')
export class MesMakeProcessController {
  @Post('/getprocesstategroupsupplier')
  async getProcessStateGroupSupplier(): Promise<{ success: boolean; code: number; count: number; data: PurSupplierGroupVo[]; ex: any }> {
    // 用 Mock.js 生成符合 DTO 的数据
    const data: PurSupplierGroupVo[] = Mock.mock({
      'list|5': [
        {
          'supplierId|+1': 1000,
          'supplierName': '@cword(3,5)',
          'stateCountVoList|3-6': [
            {
              'state|1-50': 1,
              'countNum|1-20': 1
            }
          ]
        }
      ]
    }).list;

    return {
      success: true,
      code: 200,
      count: data.length,
      data,
      ex: null
    };
  }
}